03. Containers vs VMs

Containers vs. Virtual Machines

Containers vs. Virtual Machines

In the previous concept, it was mentioned that containers are a light-weight option to bundle an application with its environment. In this concept, you will learn more about the differences between containers and VMs.

A VM is like a complete computer, with its own copy of an operating system and virtual hardware. Just as with containers, a single physical machine (the host machine) can run many virtual machines to scale the number of isolated applications. While virtual machines work well for scaling applications, since they virtualize an entire machine, they can be resource intensive. This is where containers can be an improvement.

Instead of virtualizing an entire operating system and hardware, containers package and run programs on a single host operating system by sharing the operating system kernel and partitioning the operating system’s resources. In the container model, there are no virtual operating systems or virtual hardware, which reduces the total resources needed to run them.

FSND C4 L1 A03 Containers Vs Virtual Machines

Heading

Recap

For a recap of the differences between containers and VMs, see the image and text below.

VMs vs Containers

VM vs Container Architecture

VM vs Container Architecture

Containers vs Virtual Machines Summary

Virtual Machines (VMs):

Virtual machines bundle together an application with it’s dependencies. Each VM has a complete OS, and multiple VMs can be run on the same host. The host operating system runs the VMs using a hypervisor, which is a special software that creates and manages the VMs. The hypervisor maintains logical separation of the VMs to prevent a problem with any one VM from affecting other VMs or the host operating system.

Containers:

Containers also bundle together an application with it’s dependencies. Unlike VMs, containers do not have separate operating systems or virtualized hardware. They share a single operating system kernel. In practice, the containers are managed by a container manager, which serves a role similar to the hypervisor in a VM scenario. Containers are lighter-weight than VMs and have faster start-up times.

Quizzes

Containers vs. VMs

Which of these choices is true?

SOLUTION: Containers share a kernel.

Containers vs. VMs

QUESTION:

Containers are lighter and faster to start than VMs due to their shared:

SOLUTION:

NOTE: The solutions are expressed in RegEx pattern. Udacity uses these patterns to check the given answer

What are containers Summary

Resources

Some popular Virtual Machine platforms are VMWare , VirtualBox , and Parallels Desktop .

Some common container platforms include Rkt , LXC and LXD , OpenVz , and Docker . Docker is the most popular container platform, and will be used throughout this course. You will learn more about how to use Docker in the next concept.

Further Research